/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package VIEW;

import BEANS.ComboItem;
import CONTROLLERS.SecHandTradeInController;
import UTIL.InputValidator;
import datechooser.beans.DateChooserCombo;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author weak_2030
 */
public class TradeProduct extends javax.swing.JPanel {
    private static SecHandTradeInController tradeInController;
    /**
     * Creates new form TradeProduct
     */
    public TradeProduct() {
        initComponents();
        tradeInController = new SecHandTradeInController(productNameInput, descriptionInput, dateOfSwapInput,categoryComboBox, secondHandTable, tradeInHistory,fromDate, toDate, multipleProductNameInput, multipleDescriptionInput, multipleCategoryComboBox, multipleDateOfSwap, multipleCustomerItemTable, multipleSecondHandTable, secondHandSearchInput, multipleClearMark, singleClearMark, searchInput);
        InputValidator.enabler(multipleCustomerItemTable, jButton5);
        InputValidator.enabler2(multipleCustomerItemTable, jButton7);
        InputValidator.enabler(multipleCustomerItemTable, jButton4);
        InputValidator.enabler(multipleSecondHandTable, jButton4);
        jTabbedPane1.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tradeInHistoryDialog = new javax.swing.JDialog();
        jLabel7 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tradeInHistory = new javax.swing.JTable();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        fromDate = new datechooser.beans.DateChooserCombo();
        toDate = new datechooser.beans.DateChooserCombo();
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        multipleCustomerItemTable = new javax.swing.JTable();
        jLabel14 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        multipleSecondHandTable = new javax.swing.JTable();
        jButton4 = new javax.swing.JButton();
        multipleProductNameInput = new javax.swing.JTextField();
        multipleDescriptionInput = new javax.swing.JTextField();
        multipleCategoryComboBox = new javax.swing.JComboBox<ComboItem>();
        multipleDateOfSwap = new datechooser.beans.DateChooserCombo();
        jLabel15 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jButton6 = new javax.swing.JButton();
        multipleClearMark = new javax.swing.JLabel();
        secondHandSearchInput = new javax.swing.JTextField();
        jButton5 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        productNameInput = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        categoryComboBox = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        descriptionInput = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        singleClearMark = new javax.swing.JLabel();
        dateOfSwapInput = new datechooser.beans.DateChooserCombo();
        jLabel6 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        secondHandTable = new javax.swing.JTable();
        jButton1 = new javax.swing.JButton();
        searchInput = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();

        tradeInHistoryDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        tradeInHistoryDialog.setTitle("Secondhand Product Trade-in History");
        tradeInHistoryDialog.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel7.setText("History");

        tradeInHistory.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        tradeInHistory.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Date Swapped", "Customer Product", "Description", "Swapped Product"
            }
        ));
        tradeInHistory.setRowHeight(20);
        jScrollPane2.setViewportView(tradeInHistory);

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel8.setText("From:");

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel9.setText("To:");

        javax.swing.GroupLayout tradeInHistoryDialogLayout = new javax.swing.GroupLayout(tradeInHistoryDialog.getContentPane());
        tradeInHistoryDialog.getContentPane().setLayout(tradeInHistoryDialogLayout);
        tradeInHistoryDialogLayout.setHorizontalGroup(
            tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tradeInHistoryDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 650, Short.MAX_VALUE)
                    .addGroup(tradeInHistoryDialogLayout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fromDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(13, 13, 13)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(toDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        tradeInHistoryDialogLayout.setVerticalGroup(
            tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tradeInHistoryDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
                .addGroup(tradeInHistoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fromDate, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(toDate, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Trade/Swap Product");
        add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 0, 0));

        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel10.setText("Product Name:");
        jPanel2.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 21, -1, -1));

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel11.setText("Description:");
        jPanel2.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 47, -1, -1));

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel12.setText("Category:");
        jPanel2.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(41, 73, -1, -1));

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel13.setText("Date of Swap:");
        jPanel2.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 10, -1, -1));

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton3.setText("Add Product");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 70, -1, -1));

        multipleCustomerItemTable.setAutoCreateRowSorter(true);
        multipleCustomerItemTable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        multipleCustomerItemTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "cateogry_id", "Product Name", "Description", "Category"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        multipleCustomerItemTable.setRowHeight(20);
        jScrollPane3.setViewportView(multipleCustomerItemTable);

        jPanel2.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 138, -1, 310));

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel14.setText("Secondhand Product List:");
        jPanel2.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 50, -1, -1));

        multipleSecondHandTable.setAutoCreateRowSorter(true);
        multipleSecondHandTable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        multipleSecondHandTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Product_id", "Product Name", "Description", "Type"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        multipleSecondHandTable.setRowHeight(20);
        jScrollPane4.setViewportView(multipleSecondHandTable);

        jPanel2.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(508, 73, 500, 380));

        jButton4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton4.setText("Trade/Swap Products");
        jButton4.setEnabled(false);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(820, 460, -1, -1));
        jPanel2.add(multipleProductNameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(107, 21, 200, -1));
        jPanel2.add(multipleDescriptionInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(107, 47, 200, -1));

        multipleCategoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel2.add(multipleCategoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(107, 73, 200, -1));

        multipleDateOfSwap.setWeekStyle(datechooser.view.WeekDaysStyle.FULL);
        jPanel2.add(multipleDateOfSwap, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 10, 200, -1));

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel15.setText("Secondhand Products to be traded:");
        jPanel2.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, -1, -1));

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jPanel2.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 11, 20, 500));

        jButton6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton6.setText("Search");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 40, -1, -1));

        multipleClearMark.setIcon(new javax.swing.ImageIcon(getClass().getResource("/UI ICONS/xmark.png"))); // NOI18N
        multipleClearMark.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                multipleClearMarkMouseClicked(evt);
            }
        });
        jPanel2.add(multipleClearMark, new org.netbeans.lib.awtextra.AbsoluteConstraints(900, 40, -1, 20));

        secondHandSearchInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jPanel2.add(secondHandSearchInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 40, 180, -1));

        jButton5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton5.setText("Remove");
        jButton5.setEnabled(false);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 450, 90, -1));

        jButton7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton7.setText("Clear List");
        jButton7.setEnabled(false);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 450, -1, -1));

        add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 41, -1, 520));

        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Product Name:");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 14, -1, -1));

        productNameInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        productNameInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productNameInputActionPerformed(evt);
            }
        });
        jPanel1.add(productNameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 11, 250, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel3.setText("Category:");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 40, -1, -1));

        categoryComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        categoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        categoryComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                categoryComboBoxActionPerformed(evt);
            }
        });
        jPanel1.add(categoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 41, 250, -1));

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel4.setText("Description:");
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 74, -1, -1));

        descriptionInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        descriptionInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                descriptionInputActionPerformed(evt);
            }
        });
        jPanel1.add(descriptionInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 71, 250, -1));

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel5.setText("Date of Swap:");
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 105, -1, -1));

        singleClearMark.setIcon(new javax.swing.ImageIcon(getClass().getResource("/UI ICONS/xmark.png"))); // NOI18N
        singleClearMark.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                singleClearMarkMouseClicked(evt);
            }
        });
        jPanel1.add(singleClearMark, new org.netbeans.lib.awtextra.AbsoluteConstraints(910, 40, 20, 30));

        dateOfSwapInput.setFormat(0);
        dateOfSwapInput.setFieldFont(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 14));
        jPanel1.add(dateOfSwapInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 105, 247, -1));

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel6.setText("Secondhand Product List:");
        jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(453, 44, -1, -1));

        secondHandTable.setAutoCreateRowSorter(true);
        secondHandTable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        secondHandTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ProductId", "Product Name", "Description", "Type", "Quantity"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        secondHandTable.setRowHeight(20);
        jScrollPane1.setViewportView(secondHandTable);

        jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(453, 71, 561, 360));

        jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton1.setText("Trade/Swap Products");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 440, -1, -1));

        searchInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jPanel1.add(searchInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(733, 42, 200, -1));

        jButton2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton2.setText("Search");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(939, 40, -1, -1));

        jTabbedPane1.addTab("Single Product", jPanel1);

        add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 1040, 550));

        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel16.setText("Trade/Swap to Secondhand Products");
        add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 10, 1050, -1));
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        tradeInController.swapSecondHandToSecondHand();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void descriptionInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_descriptionInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_descriptionInputActionPerformed

    private void productNameInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productNameInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_productNameInputActionPerformed

    private void categoryComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_categoryComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_categoryComboBoxActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        tradeInController.addToMultipleItemsTable();
        InputValidator.enabler(multipleCustomerItemTable, jButton5);
        InputValidator.enabler2(multipleCustomerItemTable, jButton7);
        InputValidator.enabler(multipleCustomerItemTable, jButton4);
        InputValidator.enabler(multipleSecondHandTable, jButton4);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        tradeInController.removeSelectedCustomerItem();
        InputValidator.enabler(multipleCustomerItemTable, jButton5);
        InputValidator.enabler2(multipleCustomerItemTable, jButton7);
        InputValidator.enabler(multipleCustomerItemTable, jButton4);
        InputValidator.enabler(multipleSecondHandTable, jButton4);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        tradeInController.clearMultipleItemsTable();
        InputValidator.enabler(multipleCustomerItemTable, jButton5);
        InputValidator.enabler2(multipleCustomerItemTable, jButton7);
        InputValidator.enabler(multipleCustomerItemTable, jButton4);
        InputValidator.enabler(multipleSecondHandTable, jButton4);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        tradeInController.tradeMultipleSecondHand();
        InputValidator.enabler(multipleCustomerItemTable, jButton5);
        InputValidator.enabler2(multipleCustomerItemTable, jButton7);
        InputValidator.enabler(multipleCustomerItemTable, jButton4);
        InputValidator.enabler(multipleSecondHandTable, jButton4);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        tradeInController.searchMultipleSecondHandTable();
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        tradeInController.searchSingleSecondHandTable();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void singleClearMarkMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_singleClearMarkMouseClicked
        tradeInController.clearSearch5();
    }//GEN-LAST:event_singleClearMarkMouseClicked

    private void multipleClearMarkMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_multipleClearMarkMouseClicked
        tradeInController.clearSearch4();
    }//GEN-LAST:event_multipleClearMarkMouseClicked

    public static JComboBox<ComboItem> getCategoryComboBox(){
        return categoryComboBox;
    }
    
    public static JComboBox<ComboItem> getMultipleCategoryComboBox(){
        return multipleCategoryComboBox;
    }
    public static void updateTradeInHistory(){
        tradeInController.updateSecondhandSwapHistory();
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private static javax.swing.JComboBox categoryComboBox;
    private datechooser.beans.DateChooserCombo dateOfSwapInput;
    private javax.swing.JTextField descriptionInput;
    private datechooser.beans.DateChooserCombo fromDate;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private static javax.swing.JComboBox<ComboItem> multipleCategoryComboBox;
    private javax.swing.JLabel multipleClearMark;
    private javax.swing.JTable multipleCustomerItemTable;
    private datechooser.beans.DateChooserCombo multipleDateOfSwap;
    private javax.swing.JTextField multipleDescriptionInput;
    private javax.swing.JTextField multipleProductNameInput;
    private javax.swing.JTable multipleSecondHandTable;
    private javax.swing.JTextField productNameInput;
    private javax.swing.JTextField searchInput;
    private javax.swing.JTextField secondHandSearchInput;
    private javax.swing.JTable secondHandTable;
    private javax.swing.JLabel singleClearMark;
    private datechooser.beans.DateChooserCombo toDate;
    private static javax.swing.JTable tradeInHistory;
    private javax.swing.JDialog tradeInHistoryDialog;
    // End of variables declaration//GEN-END:variables
}
